home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk4 / update / cpdoc next >
Text File  |  1995-03-18  |  6KB  |  116 lines

  1.       UpDate - a replacement for AmigaDos Copy that retains the date.
  2.  
  3.       I recently downloaded from People Link an ARC file containing
  4.       two different "copy" replacements. One would copy only if the
  5.       destination did not exist, or was older. It copied full directories
  6.       if the destination existed, but would not create any.
  7.       The other used pattern matching and would accept the "all" switch,
  8.       but copied over files without regard to date.
  9.       Both revised the date of the copy to match the orriginal.
  10.       I decided to combine the best traits of both. Since "Disk.info"
  11.       and ".info" (that's plain ".info" as found in any drawer whos
  12.       window has been opened from Workbench) are usually "eccess
  13.       baggage" when updating a directory, (who needs to update
  14.       "Disk.info" and DOS updates ".info" every time you write to
  15.       or delete from a directory) they waste time if copied. Hence
  16.       "UpDate" won't copy them. So if you need to copy "Disk.info",
  17.       use "good ole copy"! (Somebody please tell me why DOS doesn't
  18.       copy the filedate? Who cares WHEN it was COPIED? We do, often,
  19.       care when it was CREATED or REVISED!)
  20.       As an added bonus, UpDate copies the comment, if any, attached 
  21.       to the file. (Something ELSE AmigaDOS SHOULD do!)
  22.  
  23.       UpDate is a child of "Cp"
  24.         by Jeff Lydiatt
  25.         Vancouver, Canada
  26.         Release 1.0, May 17, 1987
  27.  
  28.       whos c source was the basis for most of it.
  29.       Cp was cleaned up to remove some potential leftover
  30.       file locks (in event of error).
  31.       UpDate modifies Cp to NOT copy if destination file same date,
  32.       or newer than source, to copy comments, to ignor ".info" and.
  33.       "Disk.info", and to create destination directories in more
  34.       casses. For example, orriginally given "Cp DF1:#?.c RAM:Work",
  35.       Cp would dutifully copy each file on DF1: whose name endded in
  36.       ".c" to a FILE named "RAM:Work" if the directory named "RAM:Work"
  37.       did not exist! UpDate would, in the same instance, first create
  38.       "RAM:Work", and then copy the files into it.
  39.       The orriginal code was also made shorter so that the net increase
  40.       WITH the added features increased code size from 7576 for Cp
  41.       to 7964 for UpDate. (Compared to AmigaDOS "copy" at 8128!).
  42.       
  43.       Many thanks to Jeff for his C code. I will happily provide
  44.       the modified code, should someone want it.
  45.       
  46.       Enjoy!
  47.                    John Scheib  (PLink "JSCHEIB")
  48.  
  49. UpDate has most of the features of the AmigaDos copy command:
  50. --------------------------------------------------------
  51.  
  52.    o UpDate supports AmigaDos style pattern matching in the "from" name.
  53.    o UpDate supports the All option.
  54.    o UpDate supports optional "from" and "to" qualifiers for file names.
  55.    o UpDate will copy directories
  56.  
  57. UpDate has a number of features not found in AmigaDos copy:
  58. -------------------------------------------------------
  59.  
  60.    o UpDate will retain the date of the copied file.
  61.    o UpDate uses a 32000 byte buffer, which speeds copies when the from and
  62.      to file is on the same disk.
  63.    o UpDate WILL NOT copy "Disk.info" or ".info" (will copy 
  64.       "FileName.info").
  65.    o UpDate will creat destination directories. (See Examples)
  66.    o UpDate will copy file comments.
  67.    o You may specify the current directory by a "to" name of ".".  For
  68.          example if your current directory is "Df0:",
  69.         "cp ram:x ."
  70.          will copy the file called x in your ram: disk to "df0:x".
  71.    o UpDate will also create the "to" file for you if you use the "All"
  72.          option.  For example if "x" is a directory,
  73.              "cp from x to y"
  74.          will create a directory called "y", and will copy all the files in
  75.          x to the newly created "y" directory.
  76.  
  77. About the AmigaDos-style pattern matching.
  78. -----------------------------------------
  79.  
  80.    UpDate uses a compact function for regular expression pattern matching.
  81. The algorithm was taken from a paper by Martin Richards, that was
  82. published in the September 1979 issue of "Software, Practice and
  83. Experience".  Professor Richards published his example in BCPL, and
  84. Mr. Lydiatt has (sucessfully I think) translated it to C.  It's interesting to
  85. note that he translated it verbatim, with no special modifications to
  86. adapt it to AmigaDos conventions.
  87.  
  88.   UpDate recognises a number of special characters with special meanings,
  89. which can be used to recognise any other charcaters that match them. 
  90.  
  91.   ?    Matches any single character.
  92.   %    Matches the null character.
  93.   #<p>  Matches zero or more occurrences of the pattern <p>
  94.   <p1>|<p2> Matches either pattern <p1> or <p2>.
  95.   ()    Can be used to group expressions together.
  96.   '#    Can be used to turn off the special meaning of the special
  97.         characters #, ?, %, |, (, ), or '.  
  98.  
  99.   Some examples will help to make this clearer.
  100.  
  101.   UpDate a|b .    copies a or b to the current directory.
  102.   UpDate a#bc .    copies ac abc abbc.
  103.   UpDate a#(b|c)d .    copies ad abd abcd.
  104.   UpDate a?b .    copies axb ayb aab.
  105.   UpDate a#?b    copies ab axxb ax.ab.
  106.   UpDate '?#?'# .    copies ?# ?ab# ??##.
  107.   UpDate a(b|%)#c . copies a abc accc.
  108.   
  109.   UpDate FileName1 To FileName2 copies FileName1 to FileName2 (except as noted)
  110.   UpDate DirectoryName PotenTialDirectoryName creats the destination if
  111.       it doesn't exist. For Example:
  112.   "UpDate DF1: RAM:Work" will create RAM:Work if it does not exist.
  113.       and will the update it to match files on DF1:.
  114.   "UpDate DF1:#?whatever RAM:Work" would do the same with pattern matching.
  115.  
  116.